<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
		xmlns:ice="http://www.icesoft.com/icefaces/component"  
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
    
    <ice:form id="listholeFormId" styleClass="edit">
      <ice:panelGroup  id="searchGroup" styleClass="formBorderHighlight">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                  <td class="iceDatTblColHdr2">
                    <ice:outputText id="listHoleId" value="Hole search"/>
                 </td>
              </tr>
         </table>	
         <ice:panelGroup id="listPanelGroupHoleId" styleClass="edit">
		
            <s:decorate id="namedecId" template="layout/display.xhtml">
                <ui:define name="label">name</ui:define>
                <ice:inputText id="listnameTextId" 
                          value="#{holeList.hole.name}"
				  partialSubmit="true"/>
            </s:decorate>

          
   
	  </ice:panelGroup>
  
        
        <div class="actionButtons">
            <ice:commandButton id="listSearchButtonId" value="Search" action="/HoleList.xhtml"/>
        </div>
      </ice:panelGroup> 
    </ice:form>
    
    <ice:panelGroup styleClass="formBorderHighlight">

    <h3>hole  search results</h3>

    <div class="searchResults" id="listholeResults">
    <ice:outputText value="The hole search returned no results." 
               rendered="#{empty holeList.resultList}"/>
               
    <ice:dataTable id="holeListTableId" 
                  var="hole"
                value="#{holeList.resultList}" 
            resizable="true"
        columnClasses="allCols"
             rendered="#{not empty holeList.resultList}">
        <ice:column id="listidId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listidLinkId"
                             value="id #{holeList.order=='id asc' ? messages.down : ( holeList.order=='id desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{holeList.order=='id asc' ? 'id desc' : 'id asc'}"/>
                </s:link>
            </f:facet>
            #{hole.id}&amp;nbsp;
        </ice:column>
        <ice:column id="listColumncourseId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		                id="listcolumnHeadercourseId"
                             value="course id #{holeList.order=='course.id asc' ? messages.down : ( holeList.order=='course.id desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{holeList.order=='course.id asc' ? 'course.id desc' : 'course.id asc'}"/>
                </s:link>
            </f:facet>
            #{hole.course.id}
        </ice:column>
        <ice:column id="listladiesHandicapId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listladiesHandicapLinkId"
                             value="ladiesHandicap #{holeList.order=='ladiesHandicap asc' ? messages.down : ( holeList.order=='ladiesHandicap desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{holeList.order=='ladiesHandicap asc' ? 'ladiesHandicap desc' : 'ladiesHandicap asc'}"/>
                </s:link>
            </f:facet>
            #{hole.ladiesHandicap}&amp;nbsp;
        </ice:column>
        <ice:column id="listladiesParId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listladiesParLinkId"
                             value="ladiesPar #{holeList.order=='ladiesPar asc' ? messages.down : ( holeList.order=='ladiesPar desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{holeList.order=='ladiesPar asc' ? 'ladiesPar desc' : 'ladiesPar asc'}"/>
                </s:link>
            </f:facet>
            #{hole.ladiesPar}&amp;nbsp;
        </ice:column>
        <ice:column id="listmensHandicapId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listmensHandicapLinkId"
                             value="mensHandicap #{holeList.order=='mensHandicap asc' ? messages.down : ( holeList.order=='mensHandicap desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{holeList.order=='mensHandicap asc' ? 'mensHandicap desc' : 'mensHandicap asc'}"/>
                </s:link>
            </f:facet>
            #{hole.mensHandicap}&amp;nbsp;
        </ice:column>
        <ice:column id="listmensParId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listmensParLinkId"
                             value="mensPar #{holeList.order=='mensPar asc' ? messages.down : ( holeList.order=='mensPar desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{holeList.order=='mensPar asc' ? 'mensPar desc' : 'mensPar asc'}"/>
                </s:link>
            </f:facet>
            #{hole.mensPar}&amp;nbsp;
        </ice:column>
        <ice:column id="listnameId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listnameLinkId"
                             value="name #{holeList.order=='name asc' ? messages.down : ( holeList.order=='name desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{holeList.order=='name asc' ? 'name desc' : 'name asc'}"/>
                </s:link>
            </f:facet>
            #{hole.name}&amp;nbsp;
        </ice:column>
        <ice:column id="listnumberId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listnumberLinkId"
                             value="number #{holeList.order=='number asc' ? messages.down : ( holeList.order=='number desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{holeList.order=='number asc' ? 'number desc' : 'number asc'}"/>
                </s:link>
            </f:facet>
            #{hole.number}&amp;nbsp;
        </ice:column>
        <ice:column id="listColumnHoleId">
            <f:facet name="header">action</f:facet>
            <s:link view="/#{empty from ? 'Hole' : from}.xhtml" 
                   value="Select" 
                      id="listholeLinkId">
                <f:param name="holeId" 
                        value="#{hole.id}"/>
            </s:link>
        </ice:column>
    </ice:dataTable>

    </div>
</ice:panelGroup>

    <div class="tableControl">
      
        <s:link view="/HoleList.xhtml" 
            rendered="#{holeList.previousExists}" 
               value="#{messages.left}#{messages.left} First Page"
                  id="firstPageholeListId">
          <f:param name="firstResult" value="0"/>
        </s:link>
        
        <s:link view="/HoleList.xhtml" 
            rendered="#{holeList.previousExists}" 
               value="#{messages.left} Previous Page"
                  id="previousPageholeListId">
            <f:param name="firstResult" 
                    value="#{holeList.previousFirstResult}"/>
        </s:link>
        
        <s:link view="/HoleList.xhtml" 
            rendered="#{holeList.nextExists}" 
               value="Next Page #{messages.right}"
                  id="nextPageholeListId">
            <f:param name="firstResult" 
                    value="#{holeList.nextFirstResult}"/>
        </s:link>
        
        <s:link view="/HoleList.xhtml" 
            rendered="#{holeList.nextExists}" 
               value="Last Page #{messages.right}#{messages.right}"
                  id="lastPageholeListId">
            <f:param name="firstResult" 
                    value="#{holeList.lastFirstResult}"/>
        </s:link>
        
    </div>
    
    <s:div styleClass="actionButtons" rendered="#{empty from}">
        <s:button view="/HoleEdit.xhtml"
                    id="listCreateholeId" 
                 value="Create hole">
            <f:param name="holeId"/>
        </s:button>
    </s:div>
    
</ui:define>

</ui:composition>

